<template>
  <view>
    <view class="consult-box" @click.stop="consultHandle()">
      <text> 立即预约 </text>
    </view>
    <myPopup
      ref="myPopup"
      :content="content"
      v-if="isShow"
      @childFn="parentFn"
      :showStatus="isShow"
    ></myPopup>
  </view>
</template>

<script>
import myPopup from "@/myComponents/myPopup/index.vue";

export default {
  components: {
    myPopup,
  },

  props: {
    itemObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      isShow: false,
      content: {
        type: "PARK_BOOKING",
        field1: "",
      },
    };
  },

  mounted() {
    this.content.field1 = this.itemObj.parkName;
  },

  methods: {
    consultHandle() {
      this.isShow = true;
    },
    parentFn(payload) {
      console.log(payload);
      this.isShow = payload;
    },
  },
};
</script>

<style lang="less" scoped>
.consult-box {
  width: 88px;
  height: 28px;
  line-height: 28px;
  background: #fe5430;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  color: #ffffff;
  text-align: center;
}
</style>
